package cc.miwuya.community.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 小区表
 * @TableName residential
 */
@TableName(value ="residential")
@Data
public class Residential implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 
     */
    private Long propertyId;

    /**
     * 物业费单价
     */
    private BigDecimal propertyPrice;

    /**
     * 小区名
     */
    private String name;

    /**
     * 小区地址
     */
    private String address;

    /**
     * 建成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime completion;

    /**
     * 建筑面积
     */
    private Double buildArea;

    /**
     * 总户数
     */
    private Long buildAccount;

    /**
     * 绿化率
     */
    private Double greeningRate;

    /**
     * 开发商
     */
    private String developer;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Residential other = (Residential) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPropertyId() == null ? other.getPropertyId() == null : this.getPropertyId().equals(other.getPropertyId()))
            && (this.getPropertyPrice() == null ? other.getPropertyPrice() == null : this.getPropertyPrice().equals(other.getPropertyPrice()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getCompletion() == null ? other.getCompletion() == null : this.getCompletion().equals(other.getCompletion()))
            && (this.getBuildArea() == null ? other.getBuildArea() == null : this.getBuildArea().equals(other.getBuildArea()))
            && (this.getBuildAccount() == null ? other.getBuildAccount() == null : this.getBuildAccount().equals(other.getBuildAccount()))
            && (this.getGreeningRate() == null ? other.getGreeningRate() == null : this.getGreeningRate().equals(other.getGreeningRate()))
            && (this.getDeveloper() == null ? other.getDeveloper() == null : this.getDeveloper().equals(other.getDeveloper()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPropertyId() == null) ? 0 : getPropertyId().hashCode());
        result = prime * result + ((getPropertyPrice() == null) ? 0 : getPropertyPrice().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getCompletion() == null) ? 0 : getCompletion().hashCode());
        result = prime * result + ((getBuildArea() == null) ? 0 : getBuildArea().hashCode());
        result = prime * result + ((getBuildAccount() == null) ? 0 : getBuildAccount().hashCode());
        result = prime * result + ((getGreeningRate() == null) ? 0 : getGreeningRate().hashCode());
        result = prime * result + ((getDeveloper() == null) ? 0 : getDeveloper().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", propertyId=").append(propertyId);
        sb.append(", propertyPrice=").append(propertyPrice);
        sb.append(", name=").append(name);
        sb.append(", address=").append(address);
        sb.append(", completion=").append(completion);
        sb.append(", buildArea=").append(buildArea);
        sb.append(", buildAccount=").append(buildAccount);
        sb.append(", greeningRate=").append(greeningRate);
        sb.append(", developer=").append(developer);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}